package ks.client.gui.admin.icon.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import ks.client.UserContext;
import ks.client.gui.admin.icon.IconAdminGui;
import ks.client.lobby.Lobby;


/**
 * 
 * Opens the administrators icons GUI when the "Icon Controls" button is clicked. 
 * 
 * @author Jennifer Hunt
 *
 */
public class IconAdminClickController implements ActionListener{
	
	Lobby lobby;
	UserContext context;
	
	/**
	 * Constructor for IconAdminClickController
	 * 
	 * @param lobby
	 */
	public IconAdminClickController(Lobby lobby) {
		this.lobby = lobby;
		context = lobby.getUserContext();
	}
	
	/**
	 * 
	 * Button is clicked, the IconAdminGui is shown.
	 * 
	 */
	public void actionPerformed(ActionEvent e){
			JFrame pma = new IconAdminGui(lobby);
			pma.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
			pma.setTitle("Icon Admin Controls");
			pma.setVisible(true);
	}
}
